<script type="text/javascript">
<?php if ($admin_login_status == true) {?>function delete_single_list(id){if(confirm('你确认要删除该文章?')){$.post('<?php echo $this->create_url('admin_article/ajax_delete_article'); ?>', {mode:0,list_id:id}, function(data){switch(data){case '101':alert('删除成功!');location.href='<?php echo $this->get_action_url('index'); ?>';break; case '100':alert('对不起!操作失败,请重新操作');break;default:alert(data);}});}else{return false;}}
function delete_comment_list(id){if(!confirm('你确认要进行删除操作?')){return false;}$.post('<?php echo $this->create_url('admin_comment/ajax_delete_comment'); ?>', {mode:0,list_id:id}, function(data){if(data==101){alert('恭喜!删除成功!');location.reload();}else{alert(data);}});}
<?php } if($admin_login_status == true && is_verify == 1) {?>function edit_single_list(id){$.post('<?php echo $this->create_url('admin_comment/ajax_verlidata_comment'); ?>', {mode:0,list_id:id}, function(data){if(data==101){alert('恭喜,操作成功!');location.reload();}else{alert(data);}});}<?php } ?></script>
<table width="760" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:20px;">
  <tr>
    <td height="30" align="left" style="color:#666666; font-size:16px;">文章：</td>
  </tr>
</table>
<table width="760" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="left">
<table width="100%" border="0" cellspacing="0" cellpadding="0" style="margin-bottom:30px;">
      <tr>
        <td height="30" align="left" style="font-size:18px;">&nbsp;<?php echo $post_data['post_title']; ?></td>
      </tr>
      <tr>
        <td height="20" align="left" style="font-size:12px; line-height:20px; color:#666666;">&nbsp;作者：<?php echo $post_author; ?> &nbsp;发表时间：<?php echo $post_data['date_added']; ?></td>
      </tr>
      <tr>
        <td align="left"><div style="font-size:12px; line-height:20px; margin-top:10px; margin-bottom:30px;"><?php echo $post_data['post_content']; ?> <?php if($post_data['date_modified'] == true) { ?><span style="color:#CCCCCC;">文章最后编辑时间:<?php echo $post_data['date_modified']; ?></span><?php } ?></div></td>
      </tr>
      <tr style="font-size:12px; line-height:20px; color:#999999;">
        <td height="20" align="left">分类：<?php echo $post_class; ?>&nbsp;标签：<?php echo $tag_str; ?>&nbsp;<?php if($admin_login_status) { ?><a href="<?php echo $this->create_url('admin_article/ajax_tb_edit_article'); ?>/?id=<?php echo $post_data['post_id']; ?>">编辑</a>&nbsp;<a href="javascript:void(0);" onclick="delete_single_list(<?php echo $post_data['post_id']; ?>)">删除</a><?php } ?></td>
      </tr>
</table>	
	</td>
  </tr>
  <tr>
    <td height="30" align="left">评论：</td>
  </tr>
  <tr>
    <td align="left"><table width="100%" border="0" cellspacing="0" cellpadding="0" style="font-size:12px; line-height:20px; margin-bottom:30px;">
	  <?php if($comment_data) { foreach($comment_data as $key=>$lines) {?>
      <tr style="color:#999999;">
        <td height="20"><?php echo $key + 1; ?>.&nbsp;作者:<?php echo $lines['comment_author']; ?>&nbsp;评论时间：<?php echo $lines['comment_date']; ?></td>
      </tr>
      <tr style="margin-bottom:10px;">
        <td><?php echo $lines['comment_content']; ?><?php if(admin_login_status) {?><br />
          <?php if($is_verify ==1 && $lines['approved'] ==0) {?><a href="javascript:void(0);" onclick="edit_single_list(<?php echo $lines['comment_id']; ?>)">审核</a>&nbsp;<?php } ?><a href="javascript:void(0);" onclick="delete_comment_list(<?php echo $lines['comment_id']; ?>)">删除</a><?php } ?></td>
      </tr>
	  <?php } } else {?>
      <tr>
        <td height="20" align="center">暂无评论</td>
      </tr>
	  <?php } ?>
    </table>
<script type="text/javascript">$(document).ready(function(){
	$('#comment_submit_button').click(function(){
		var nickname=$('#nickname_box').val();
		var email_url=$('#comment_email').val();
		var site_url=$('#site_url_box').val();
		var content=$('#comment_content_box').val();
		if(nickname==''){
			alert('请输入用户昵称!');
			$('#nickname_box').focus();
			return false;
		}
		if(email_url==''){
			alert('请输入邮箱地址!');
			$('#comment_email').focus();
			return false;
		}
		if(content=='') {
			alert('请输入留言内容!');
			$('#comment_content_box').focus();
			return false;
		}
		$.post('<?php echo $this->get_action_url('ajax_insert_comment'); ?>', {post_id:<?php echo $post_data['post_id']; ?>,nickname:nickname,email_url:email_url,content:content,site_url:site_url}, function(data){
			if(data==101){alert('恭喜!评论发表成功');$('#comment_content_box').val('');location.reload();} else {alert(data);}
		});
	});
});</script>	
<table width="100%" border="0" cellspacing="5" cellpadding="0">
  <tr>
    <td height="30" colspan="2">发表评论：</td>
    </tr>
  <tr>
    <td width="100" height="30" align="right">用户名：</td>
    <td align="left"><input type="text" name="comment_name" id="nickname_box" /></td>
  </tr>
  <tr>
    <td width="100" height="30" align="right">邮箱：</td>
    <td align="left"><input type="text" name="comment_email" id="comment_email" /></td>
  </tr>
  <tr>
    <td width="100" height="30" align="right">个人网址：</td>
    <td align="left"><input type="text" name="site_url" id="site_url_box" />&nbsp;(格式:http://网址)</td>
  </tr>
  <tr>
    <td width="100" height="60" align="right">评论内容：</td>
    <td align="left" valign="top"><textarea name="comment_content_box" id="comment_content_box"></textarea></td>
  </tr>
  <tr>
    <td width="100" height="30">&nbsp;</td>
    <td align="left"><input type="button" name="submit_button" id="comment_submit_button" value="发表评论" /></td>
  </tr>
</table>
	</td>
  </tr>
</table>
